layui.use(['laydate', 'form'],
    function () {
        var laydate = layui.laydate;

        let form = layui.form;


        //监听提交
        form.on('submit(add)',
            function (data) {
                data = data.field;
                let res = myAjax("/back/product/add", data, "post");
                if (res.count > 0) {
                    //关闭当前frame
                    xadmin.close();

                    // 可以对父窗口进行刷新
                    xadmin.father_reload();
                } else {
                    layer.alert("增加失败");
                }
                return false;
            });

    });